import { defineStore } from 'pinia'

export const useMenuStore = defineStore('menu', {
  state: () => ({
    menus: [
      {
        path: '/dashboard',
        name: 'Dashboard',
        meta: { 
          title: '控制台',
          icon: 'DataBoard'
        }
      },
      {
        path: '/system',
        name: 'System',
        meta: { 
          title: '系统管理',
          icon: 'Setting'
        },
        children: [
          {
            path: '/system/user',
            name: 'SystemUser',
            meta: { 
              title: '用户管理',
              icon: 'User'
            }
          },
          {
            path: '/system/role',
            name: 'SystemRole',
            meta: { 
              title: '角色管理',
              icon: 'UserFilled'
            }
          },
          {
            path: '/system/menu',
            name: 'SystemMenu',
            meta: { 
              title: '菜单管理',
              icon: 'Menu'
            }
          },
          {
            path: '/system/dict',
            name: 'SystemDict',
            meta: {
              title: '字典管理',
              icon: 'Collection'
            }
          },
          {
            path: '/system/log',
            name: 'SystemLog',
            meta: {
              title: '系统日志',
              icon: 'Document'
            }
          },
          {
            path: '/system/config',
            name: 'SystemConfig',
            meta: {
              title: '系统配置',
              icon: 'Tools'
            }
          },
          {
            path: '/system/notice',
            name: 'SystemNotice',
            meta: {
              title: '系统公告',
              icon: 'Bell'
            }
          }
        ]
      },
      {
        path: '/apps',
        name: 'Apps',
        meta: { 
          title: '应用管理',
          icon: 'Shop'
        },
        children: [
          {
            path: '/apps/list',
            name: 'AppList',
            meta: { 
              title: '应用列表',
              icon: 'List'
            }
          }
        ]
      },
      {
        path: '/oa',
        name: 'Oa',
        meta: { 
          title: 'oa管理',
          icon: 'Shop'
        },
        children: [
          {
            path: '/oa/list',
            name: 'OaList',
            meta: { 
              title: '应用列表',
              icon: 'List'
            }
          },
          // {
          //   path: '/oa/flow-design',
          //   name: 'flow-design',
          //   meta: { 
          //     title: 'oa设计',
          //     icon: 'List'
          //   }
          // }
        ]
      },
    ]
  }),

  actions: {
    setMenuList(menus) {
      this.menus = menus
    },

    getMenuList() {
      return this.menus
    }
  }
}) 